import React, { useEffect, useState } from "react";

const TestPrint: React.FC = () => {
  console.log("render");
  const [num1, setNum1] = useState(100);
  const [num2, setNum2] = useState(200);

  useEffect(() => {
    console.log(1);
    setNum1(num => num + 1);
    console.log(2);
  }, []);

  useEffect(() => {
    console.log(3);
    setNum2(num => num + 1);
    console.log(4);
  }, [num1]);

  return (
    <>
      <h3>num1:{num1}</h3>
      <h3>num2:{num2}</h3>
    </>
  );
};
export default TestPrint;
